package na.learn.java.Logging;

import org.apache.log4j.AsyncAppender;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.apache.log4j.xml.DOMConfigurator;

public class CacheLogger {
	
	private AsyncAppender asyncAppender = null;

	static {
		DOMConfigurator.configure(".\\source\\na\\learn\\java\\Logging\\log4j-Config.xml");
	}

	public static Logger getLogger(String name) {
		return getLogger(name, null);

	}

	public static Logger getLogger(String name, Level level) {
		Logger cacheLogger = Logger.getLogger(name);
		if (level != null)
			cacheLogger.setLevel(level);

		return cacheLogger;

	}

}
